﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;

namespace MvcWiki.Test.Model
{
    public class WikiNamespaceFacts
    {
        [Fact]
        public void Create()
        {
            new MvcWiki.Model.WikiNamespace();
        }

        [Fact]
        public void Has_Id_Property()
        {
            var wikiNamespace = new MvcWiki.Model.WikiNamespace();

            Guid id = (Guid)wikiNamespace.Id;
        }

        [Fact]
        public void Is_Entity()
        {
            var wikiNamespace = new MvcWiki.Model.WikiNamespace();

            Assert.IsAssignableFrom<MvcWiki.Model.Entity>(wikiNamespace);
        }

        [Fact]
        public void Has_Name_Property()
        {
            var wikiNamespace = new MvcWiki.Model.WikiNamespace();

            string name = wikiNamespace.Name;
        }

        [Fact]
        public void Equals_To_Self()
        {
            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace();

            Assert.True(wikiNamespace1.Equals(wikiNamespace1));
        }

        [Fact]
        public void Equals_To_Another()
        {
            var id = Guid.NewGuid();

            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace { Id = id };

            var wikiNamespace2 = new MvcWiki.Model.WikiNamespace { Id = id };

            Assert.True(wikiNamespace1.Equals(wikiNamespace2));
        }

        [Fact]
        public void Not_Equals_To_Another()
        {
            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace { Id = Guid.NewGuid() };

            var wikiNamespace2 = new MvcWiki.Model.WikiNamespace { Id = Guid.NewGuid() };

            Assert.False(wikiNamespace1.Equals(wikiNamespace2));
        }

        [Fact]
        public void Not_Equals_To_Null()
        {
            var wikiNamespace = new MvcWiki.Model.WikiNamespace();

            Assert.False(wikiNamespace.Equals(null));
        }

        [Fact]
        public void Not_Equals_To_Another_Type()
        {
            var wikiNamespace = new MvcWiki.Model.WikiNamespace();

            var obj = new object();

            Assert.False(wikiNamespace.Equals(obj));
        }

        [Fact]
        public void Eq_To_Self()
        {
            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace();

            var wikiNamespace2 = wikiNamespace1;

            Assert.True(wikiNamespace1 == wikiNamespace2);
        }

        [Fact]
        public void Eq_To_Another()
        {
            var id = Guid.NewGuid();

            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace { Id = id };

            var wikiNamespace2 = new MvcWiki.Model.WikiNamespace { Id = id };

            Assert.True(wikiNamespace1 == wikiNamespace2);
        }

        [Fact]
        public void Not_Eq_To_Another()
        {
            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace { Id = Guid.NewGuid() };

            var wikiNamespace2 = new MvcWiki.Model.WikiNamespace { Id = Guid.NewGuid() };

            Assert.True(wikiNamespace1 != wikiNamespace2);
        }

        [Fact]
        public void Not_Eq_To_Another_Type()
        {
            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace();

            var wikiNamespace2 = new object();

            Assert.True(wikiNamespace1 != wikiNamespace2);
        }

        [Fact]
        public void Not_Eq_To_Null()
        {
            var wikiNamespace1 = new MvcWiki.Model.WikiNamespace();

            MvcWiki.Model.WikiNamespace wikiNamespace2 = null;

            Assert.True(wikiNamespace1 != wikiNamespace2);
        }

        [Fact]
        public void Has_Markup_Property()
        {
            var wikiNamespace = new MvcWiki.Model.WikiNamespace();

            MvcWiki.Model.WikiMarkup markup = wikiNamespace.Markup;
        }
    }
}
